﻿using System.Collections.Generic;
using System.Linq;
using MRGSP.SurveyMaster.Core.Model;
using MRGSP.SurveyMaster.Core.Service.Utils;

namespace MRGSP.SurveyMaster.Service.Utils
{
    public class DefaultReader : IValueReader
    {
        public IEnumerable<Answer> Read(Question question, IDictionary<string, string> f)
        {
            return question.Children.SelectMany(child => ValueReaderFactory.Get(child.Type).Read(child, f));
        }
    }
}